package com.dingding.order.core.tourism.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.dingding.common.core.base.daox.ICriteriaBaseDao;
import com.dingding.common.core.beans.special.Tourviewspot;
import com.dingding.order.core.tourism.dao.ITourviewspotDao;

/**
 * 
 * @ClassName: TourviewspotDaoImpl 
 * @Description: 旅游路线列表DAO实现类
 * @author YHQ
 * @date 2016年8月22日 下午8:34:20
 * @since V2.4.0
 * 
 */
@Component("tourviewspotDao")
public class TourviewspotDaoImpl implements ITourviewspotDao{

	private Logger log = Logger.getLogger(this.getClass());
	
	@Resource(name="criteriaBaseDao")
	private ICriteriaBaseDao criteriaBaseDao;
	
	/**
	 * 
	 * @Title: tourviewspots 
	 * @Description: 获取旅游路线列表
	 * @param @return    设定文件 
	 * @author YHQ 
	 * @since V2.4.0
	 * @return List<Tourviewspot>    返回类型
	 * 
	 */
	@Override
	@Transactional(readOnly=true)
	public List<Tourviewspot> tourviewspots(String cityNo){
		
		Criterion criterion = Restrictions.and(Restrictions.eq("routeState", 1),Restrictions.eq("cityNo", cityNo));
		
		try {
			return criteriaBaseDao.queryCriteriaList(Tourviewspot.class, criterion);
		} catch (Exception e) {
			log.error("获取旅游路线列表时出现异常   类："+this.getClass()+" tourviewspots()", e);
		}
		
		return null;
	}
	
}
